<?php
include_once("../configure/admin.config.inc.php");	//--> admin global var
include_once("db.inc.php");							//--> db global var
include_once("Smarty.class.php");					//--> out template
include_once("Merchant.php");						//--> Merchant
include_once("ClassCoupon.php");					//--> Class Coupon
include_once("ClassCategory.php");					//--> category
include_once("Operation.php");						//--> Operation

require_once("controlHeader.php");					//--> system control header

$objOperate 	= new Operation();							//--> Operation
$objMerchant	= new Merchant(DB_TAG_COUPON, $uid);		//--> Merchant
$objCoupon 		= new ClassCoupon(DB_TAG_COUPON, $uid);		//--> Class Coupon
$objCategory 	= new ClassCategory(DB_TAG_COUPON, $uid);		//--> Category

$error_message 	= '';

$arrOperate = $objOperate->arrGetFromGroupIDAndMenuID($gid, $menuid);


$arrInfo 	= $objCoupon->getByID($arrOperate, $id);
$arrCatInfo = $objCategory->getByID($arrOperate, $arrInfo['categoryID']);
$arrMerInfo = $objMerchant->getByID($arrOperate, $arrInfo['merchantID']);

$arrInfo['category'] 	= $arrCatInfo['name'];
$arrInfo['merName'] 	= $arrMerInfo['name'];

/*----- out html -----*/
$smarty = new Smarty();	//----- out template
$smarty->template_dir = TEMPLATE_SYS_DIR;
$smarty->compile_dir  = CACHE_SYS_DIR;

$smarty->assign('error_message', $error_message);
$smarty->assign('menuGid', $menuGid);
$smarty->assign('menuid', $menuid);

$smarty->assign('backurl',$backurl);

$smarty->assign('arrInfo', $arrInfo);

$smarty->display('listCoupon_View.htm');
?>
